﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.ComponentModel.Design;
using System.Data;
using System.Data.SqlClient;
using System.Text.RegularExpressions;

public partial class forecastpostmyself_list : System.Web.UI.Page
{
    protected List<Model.ForecastPost> forecast = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        data();
    }
    void data()
    {
        PagedDataSource pds = new PagedDataSource();
        string sql = " and LotteryType=" + Convert.ToInt32(lotteryType.SelectedValue.ToString()) + " and posttype='" + type.SelectedItem.Text + "' and userid=" + Request["u"];
        int totalCount4 = 0;
        forecast = BLL.ForecastPost.GetPageListBysql(this.AspNetPager1.CurrentPageIndex - 1, this.AspNetPager1.PageSize, sql, out totalCount4);
        if (forecast != null)
        {
            AspNetPager1.RecordCount = totalCount4;
            pds.AllowPaging = true;
            pds.PageSize = AspNetPager1.PageSize;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
        }
        else
        {
            AspNetPager1.RecordCount = totalCount4;
            pds.AllowPaging = true;
            pds.PageSize = AspNetPager1.PageSize;
            pds.CurrentPageIndex = 1;
        }
    }

    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        data();
    }

    protected void LotteryType_SelectedIndexChanged(object sender, EventArgs e)
    {
        data();
    }
  
}